
	$(function() {
		$.ajax({
			type: "POST",
			dataType: "JSON",
			url:baseUrl+'/categoryControler/selectByServerHeaderTop4',
			contentType:'application/json;charset=UTF-8',
			success: function (result) {
				if(result!=null){
					//推荐搜索加载
					var str = "";
					for(var i=0;i<result.length;i++){
						if(i==0){
							str+="<span class=\"sstj\" serviceCode=\""+result[i].serviceCode+"\">"+result[i].serviceName+"</span>";
						}else{
							str+="<span class=\"sstj sstj-left\" serviceCode=\""+result[i].serviceCode+"\">"+result[i].serviceName+"</span>";
						}
					}
					$("#tjss").html(str);
				}else{
					$("#tjss").html("暂无数据");
				}
			},
			error: function (result) {
			}
		});
	});

	var baseUrl = "/apistore/";

	//菜单头部标题跳转事件
	$(document).on("click",".menu-title",function(e){
		var text = $(this).text();
		if(text!=null&&text!=""){
			if(text=="API中心"){
				window.location.href=baseUrl+"apihome";
			}
			else if(text=="文档中心"){
				//window.location.href=baseUrl+"apidetail?serviceCode="+serverCode;
			}
			else if(text=="支持中心"){
				//window.location.href=baseUrl+"apidetail?serviceCode="+serverCode;
			}
			else if(text=="应用商店"){
				//window.location.href=baseUrl+"apidetail?serviceCode="+serverCode;
			}
			else if(text=="应用中心"){
				//window.location.href=baseUrl+"apidetail?serviceCode="+serverCode;
			}
		}
	});

	//搜索按钮功能
	$(document).on("click","#heade_searchs",function(e){
		var heade_input = $("#heade_input").val();
		if(heade_input!=null&&heade_input!=""){
			window.location.href=baseUrl+"apilist?categoryCode=&serverName="+heade_input;
		}else{
			window.location.href=baseUrl+"apilist?categoryCode=&serverName=";
		}
	});


	//搜索推荐按钮链接
	$(document).on("click",".sstj",function(e){
		var serverCode = $(this).attr("serviceCode");
		window.location.href=baseUrl+"apidetail?serviceCode="+serverCode;
	});